public class Solution_2 {
    public int differenceOfSum(int[] nums) {
        int sum1=0,sum2=0;
        String s="";
        for(int i = 0 ;i<nums.length;i++)
        {
            sum1+=nums[i];
            while(nums[i]>0)
            {
                sum2+=nums[i]%10;
                nums[i]/=10;
            }
        }
        return sum1>sum2?sum1-sum2:sum2-sum1;
    }
}
